﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PagedList<Campaign>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Marketing Campaigns
</asp:Content>

<asp:Content ID="ContentHeader" ContentPlaceHolderID="ContentHeader" runat="server">
Marketing Campaigns
</asp:Content>

<asp:Content ID="javascript" ContentPlaceHolderID="Javascript" runat="server">
    
<script type="text/javascript">
    $(document).ready(function() {
        
        

    });

</script>
</asp:Content>

<asp:Content ID="ContentSubNav" ContentPlaceHolderID="ContentSubNav" runat="server">
   
                    
      <li class="selected"><%= Html.ActionLink("Index", "Index", "Campaign")%></li>
      <li><%= Html.ActionLink("Create", "Create", "Campaign")%></li>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<table> 
    <thead>
        <tr>
             <th><%= Html.ColumnHeader("Campaign Name", new SortExpression<Campaign>().SortAsc(x => x.CampaignName))%></th>
             <th>Campaign Type</th>
             <th><%= Html.ColumnHeader("Product Name", new SortExpression<Campaign>().SortAsc(x => x.Product.Name))%></th>
             <th><%= Html.ColumnHeader("Created", new SortExpression<Campaign>().SortAsc(x => x.Created))%></th>

             <th></th>
         </tr>
    </thead>
    <% foreach (var campaign in Model){%>
    <tr>
        <td><%= Html.Encode(campaign.CampaignName != null ? campaign.CampaignName : "")%></td>
        <td><%= Html.Encode(campaign.CampaignType)%></td>
        <td><%= Html.Encode(campaign.Product != null ? campaign.Product.Name : "") %></td>

        <td><%= Html.Encode(campaign.Created != null ? campaign.Created.Value.ToShortDateString() : "")%></td>
        <td >
            <span class=""><%= Html.ActionLink("Edit ", "Edit", new { id = campaign.CampaignId }, new { title = "Edit Item", @class = "btn btnEdit" })%></span>
            <span class=""><%= Html.ActionLink("Details ", "Details", new { id = campaign.CampaignId }, new { title = "View Item", @class = "btn btnView" })%></span>
            <span class=""><%= Html.ActionLink("Recipients ", "Recipients", new { id = campaign.CampaignId }, new { title = "Recipients", @class = "btn btnList" })%></span>

        </td>
            <%--<td><%= Html.Encode(customer.LastName != null ? customer.LastName : "")%></td>
            <td><%= Html.Encode(customer.Method.ToDisplayString()) %></td>
            <td><%= Html.Encode(customer.Category != null ? customer.Category.Name : "") %></td>
            <td><%= Html.Encode(customer.Product != null ? customer.Product.Name : "") %></td>--%>
    </tr>
    <%}%>

</table>       
         <%= Html.PagingDiv(Model)%>
 </asp:Content>
